const express = require('express')
const app = express()

app.get('/', (req, res) => {
    var data = {}
    data.code = 200
    data.msg = "请求成功"
    data.data = []
    var list = [
        { name: "张三", age: 14 },
        { name: "李四", age: 18 }
    ]
    list.forEach(element => {
        data.data.push(element)
    });
    setTimeout(() => {
        res.send(data)
    }, 3000)
})

app.listen(3000, () => console.log('Example app listening on port 3000!'))